<template>
  <div style="width: 1000px">
    <el-radio-group v-model="labelPosition" size="small">
      <el-radio-button label="left">左对齐</el-radio-button>
      <el-radio-button label="right">右对齐</el-radio-button>
      <el-radio-button label="top">顶部对齐</el-radio-button>
    </el-radio-group>

    <div style="margin: 20px;"></div>
    <el-form :label-position="labelPosition" label-width="80px" :model="article">
      <el-form-item label="文章编号">
        <el-input v-model="article.articleId"></el-input>
      </el-form-item>
      <el-form-item label="文章标题">
        <el-input v-model="article.articleTitle"></el-input>
      </el-form-item>
      <el-form-item label="创建人">
        <el-input v-model="article.teacherId"></el-input>
      </el-form-item>
      <el-form-item label="创建时间">
        <el-input v-model="article.crateTime"></el-input>
      </el-form-item>
      <el-form-item label="文章内容">
        <el-input v-model="article.articleContent"></el-input>
      </el-form-item>
    </el-form>
    <el-button @click="addArticle()">确认添加</el-button>
    <el-button @click="returnUp()">取消</el-button>
  </div>
</template>


<script>
  import {SystemManageService} from '../SystemManageService'
  export default {
    name: "EditArticle",
    components: {

    },
    data() {
      return {
        labelPosition: 'right',
        article: {
          articleId: '',
          articleTitle: '',
          teacherId: '',
          teacherName: '',
          articleContent: '',
          crateTime: ''
        },

      };
    },
    methods: {
      addArticle() {
        console.log(this.article);
        SystemManageService.saveArticle(this.article).then(res => {
        });
      }
    }
  }

</script>

<style scoped>

</style>
